package com.fybspace.Aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by studio on 2017/4/25.
 */

@Aspect
@Component
public class Log {

    @Pointcut("execution(public * com.fybspace..*(..))")
    public void log(){
    }

    @Before("log()")
    public void LogTimeBeforeRun(){
        System.out.println("before:"+System.currentTimeMillis());
    }

    @After("log()")
    public void LogTimeAfterRun(){
        System.out.println("after:"+System.currentTimeMillis());
    }
}
